<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html">
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title></title>
</head>
<body erke-hide>
</body>
<script>
/**
 * @param {number[]} nums1
 * @param {number[]} nums2
 * @return {number[]}
 */
var intersection = function(nums1, nums2) {
    var res=[];
    for(var i=0;i<nums1.length;i++){
		if(aAronDis(nums2,nums1[i])>=0&&aAronDis(res,nums1[i])<0){
			res.push(nums1[i]);
		};
        
	};
	console.log(res);
    return res;
};
function aAronDis(arr,obj){
	for(var i=0;i<arr.length;i++){
		if(arr[i]==obj){
			return i;
		};
	};
	return -1;
};
var res=new intersection([1, 2, 2, 1],[2, 2]);
</script>
</html>